
DEFINE BUFFER tr FOR tr_hist.

OUTPUT TO c:\220.txt.

FOR EACH tr_hist NO-LOCK WHERE tr_hist.tr_type = "iss-wo" AND tr_hist.tr_site = "220",
    EACH ptp_det NO-LOCK WHERE ptp_part = tr_hist.tr_part AND ptp_site = "220" AND ptp_pm_code = "P",
    EACH pt_mstr NO-LOCK WHERE pt_part = tr_hist.tr_part AND pt_status = "AC"    BREAK BY tr_hist.tr_part WITH STREAM-IO WIDTH 132:

    IF FIRST-OF(tr_hist.tr_part) THEN DO:
        FIND FIRST tr NO-LOCK WHERE tr.tr_type = "iss-wo" AND tr.tr_site <> "220" AND tr.tr_part = tr_hist.tr_part NO-ERROR.
        IF NOT AVAILABLE tr THEN
            DISP tr_hist.tr_part pt_desc1 + pt_desc2 FORMAT "x(80)" LABEL "Description" WITH STREAM-IO .
    END.
        

END.

OUTPUT CLOSE.
